package com.nbsaas.boot.room.rest.convert;

import com.nbsaas.boot.room.data.entity.RoomPrice;
import com.nbsaas.boot.room.api.domain.response.RoomPriceResponse;

import com.nbsaas.boot.utils.BeanDataUtils;
import com.nbsaas.boot.rest.api.Converter;
/**
* 实体对象转化成响应对象
*/

public class RoomPriceResponseConvert  implements Converter<RoomPriceResponse,RoomPrice> {

    @Override
    public RoomPriceResponse convert(RoomPrice source) {
        RoomPriceResponse  result = new  RoomPriceResponse();
        BeanDataUtils.copyProperties(source, result);
                    if(source.getRoom()!=null){
                        result.setRoom(source.getRoom().getId());
                    }
                    if(source.getRoom()!=null){
                        result.setRoomName(source.getRoom().getName());
                    }
        return result;
    }

}

